import { exec } from 'child_process'
import { promisify } from 'util'
import fs from 'fs'
import path from 'path'

export const execAsync = promisify(exec)

export function getSubDirs(srcDir) {
  return fs
    .readdirSync(srcDir, { withFileTypes: true }) // 返回 Dirent 对象
    .filter(entry => entry.isDirectory()) // 筛选目录
    .map(entry => entry.name) // 获取目录名
}
